package com.ny.controller;

import com.ny.entity.Reservations;
import com.ny.service.ReservationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class ReservationController {
    @Autowired
    private ReservationService reservationService;
    @RequestMapping("/reservations")
    public String  reservation(Model model){

        model.addAttribute("reservationList", reservationService.findAllReservations());
        return "reservations";
    }
}